<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.javaee.ejb.entity.Employee"  %>
<%@ page import="java.util.List"  %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" media="screen" href="/ProjetWebEAR/css/main.css" />
</head>
<body>
	<div id="wrapper">
		<h1>Liste des utilisateurs connectés</h1>
		<table class="emplist">
		<tr><th>Pr&eacute;nom</th><th>Nom</th><th>Chat</th></tr>
		<%
			List<Employee> l_Employee = (List<Employee>)request.getAttribute("listEmp");
			for (Employee e:l_Employee)
			{
				if(e.getIdemployee() != ((Employee)request.getSession().getAttribute("currentEmp")).getIdemployee())
				{
		%>
			<tr><td><%= e.getFirstname() %></td><td><%= e.getLastname() %>
							</td><td><a href="ChatServlet?action=start&caller=<%=((Employee)request.getSession().getAttribute("currentEmp")).getIdemployee()%>&called=<%=e.getIdemployee()%>">Demarrer une conversation</a></td></tr>
		<%
				}
			}
		%>
		</table>
	</div>
</body>
</html>